/*
 * 搬砖问题（4分）
 */

#include <stdio.h>

int main() {
	setbuf(stdout, NULL);

	int n;

	printf("Input n(27<n<=77):\n");
	scanf("%d", &n);

	for (int i = 0; i <= 36; ++i) {
		for (int j = 0; j <= 36; ++j) {
			for (int k = 0; k <= 36; ++k) {
				if (i + j + k == 36 &&
				    k % 2 == 0 &&
				    i * 4 + j * 3 + k / 2 == n) {
					printf("men=%d,women=%d,children=%d\n", i, j, k);
				}
			}
		}
	}

	return 0;
}
